package com.fowo.api.service.handleWork;

import com.fowo.api.model.loan.monthly.balance.LoanMonthlyBalanceFinishRequestPayoutAction;
import com.fowo.api.model.loan.monthly.balance.LoanMonthlyBalanceVo;
import com.fowo.api.service.LoanMonthlyBalanceService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import javax.annotation.Resource;

@Component
public class LoanMonthlyBalanceFinishRequestPayout implements LoanMonthlyBalanceFinishRequestPayoutAction {

    @Resource
    private LoanMonthlyBalanceService loanMonthlyBalanceService;

    @Override
    public void run(Long id) throws Exception {
        LoanMonthlyBalanceVo loanMonthlyBalanceVo = loanMonthlyBalanceService.getVoById(id);
        Assert.notNull(loanMonthlyBalanceVo,"改单据不存在");
        loanMonthlyBalanceVo.setStatus("40");
        loanMonthlyBalanceService.update(loanMonthlyBalanceVo);
    }
}
